class DbPopulate4 < ActiveRecord::Migration
  def self.up
    add_column :rss_links, :club_id, :integer
    add_column :clubs, :country_id, :integer
    remove_column :countries, :club_id, :integer
    @portugues = Language.find_by_code("en")
    @english = Language.find_by_code("en")
    @club = Club.create(:name => 'Internacional')

    @country = Country.create(:countryId => 'BR')
    @club.country = @country
    @country.country_localizations.create(:name => "Brasil", :language => @portugues)
    @country.country_localizations.create(:name => "Brazil", :language => @english)

    @club.rss_links.create(:link => "http://www.finalsports.com.br/03/rss_inter.php", :language => @english)
    @club.rss_links.create(:link => "http://globoesporte.globo.com/Esportes/Rss/0,,AS0-9869,00.xml", :language => @english)

    @club.save

    @club = Club.create(:name => "Grêmio")
    @club.country = @country
    @club.rss_links.create(:link => "http://www.finalsports.com.br/03/rss_gremio.php", :language => @english)
    @club.rss_links.create(:link => "http://globoesporte.globo.com/Esportes/Rss/0,,AS0-9868,00.xml", :language => @english)

    @club.save

    @country = Country.create(:countryId => 'AR')
    @country.country_localizations.create(:name => "Argentina", :language => @portugues)
    @country.country_localizations.create(:name => "Argentina", :language => @english)
    @country.save

    @country = Country.create(:countryId => 'IT')
    @country.country_localizations.create(:name => "Italia", :language => @portugues)
    @country.country_localizations.create(:name => "Italia", :language => @english)
    @country.save

    @country = Country.create(:countryId => 'EN')
    @country.country_localizations.create(:name => "Inglaterra", :language => @portugues)
    @country.country_localizations.create(:name => "England", :language => @english)
    @country.save

    @country = Country.create(:countryId => 'SP')
    @country.country_localizations.create(:name => "Epanha", :language => @portugues)
    @country.country_localizations.create(:name => "Spain", :language => @english)
    @country.save

  end

  def self.down
  end
end
